package com.zxq.ai.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum RewardType {

    CASH("cash", "现金"),

    ;

    private final String code;
    private final String desc;


    public static RewardType getByCode(String code) {
        if (Objects.isNull(code)) {
            return null;
        }

        for (RewardType value : RewardType.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }


}
